package cn.com.lms.business.learning.persistence.entity.vo;

import io.swagger.v3.oas.annotations.media.Schema;

import java.math.BigDecimal;
import java.util.Date;

/*
 * @author liuwei
 * @date 2020/3/26 11:16
 * @desc 学员计划详情实体
 */

public class LearningByStudentVo {
    @Schema(description = "最近学习时间")
    private Date lastStudyTime;
    @Schema(description = "实际完成时间")
    private Date lastFinishTime;
    @Schema(description = "部门名称")
    private String deptName;
    @Schema(description = "学习时间")
    private Integer studyTime;
    @Schema(description = "已完成数")
    private Long finishOff;
    @Schema(description = "已学时长")
    private BigDecimal learningHours;
    @Schema(description = "计划id")
    private Long planId;
    @Schema(description = "未完成数")
    private Long finishOn;
    @Schema(description = "主键")
    private Long id;
    @Schema(description = "总任务数")
    private Long sumNum;
    @Schema(description = "完成百分比")
    private BigDecimal completionStatus;
    @Schema(description = "用户名称")
    private String userName;
    @Schema(description = "用户名称")
    private Long userId;
    @Schema(description = "身份证号码")
    private String identity;
    @Schema(description = "手机号")
    private String phone;
    @Schema(description = "工号")
    private String account;
    @Schema(description = "计划完成时间")
    private Date finishTime;
    @Schema(description = "岗位类型")
    private String jobType;
    @Schema(description = "在职状态(1在职，0离职)")
    private Boolean personnel;

    private String personnelText;

    public Date getLastStudyTime() {
        return lastStudyTime;
    }

    public void setLastStudyTime(Date lastStudyTime) {
        this.lastStudyTime = lastStudyTime;
    }

    public String getDeptName() {
        return deptName;
    }

    public void setDeptName(String deptName) {
        this.deptName = deptName;
    }

    public Integer getStudyTime() {
        return studyTime;
    }

    public void setStudyTime(Integer studyTime) {
        this.studyTime = studyTime;
    }

    public Long getFinishOff() {
        return finishOff;
    }

    public void setFinishOff(Long finishOff) {
        this.finishOff = finishOff;
    }

    public BigDecimal getLearningHours() {
        return learningHours;
    }

    public void setLearningHours(BigDecimal learningHours) {
        this.learningHours = learningHours;
    }

    public Long getPlanId() {
        return planId;
    }

    public void setPlanId(Long planId) {
        this.planId = planId;
    }

    public Long getFinishOn() {
        return finishOn;
    }

    public void setFinishOn(Long finishOn) {
        this.finishOn = finishOn;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getSumNum() {
        return sumNum;
    }

    public void setSumNum(Long sumNum) {
        this.sumNum = sumNum;
    }

    public BigDecimal getCompletionStatus() {
        return completionStatus;
    }

    public void setCompletionStatus(BigDecimal completionStatus) {
        this.completionStatus = new BigDecimal(completionStatus == null ? 0 : completionStatus.intValue());
        if (completionStatus.intValue() >= 100) {
                this.setLastFinishTime(this.getLastStudyTime());
        }
    }

    public Date getLastFinishTime() {
        return lastFinishTime;
    }

    public void setLastFinishTime(Date lastFinishTime) {
        this.lastFinishTime = lastFinishTime;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account;
    }

    public Date getFinishTime() {
        return finishTime;
    }

    public void setFinishTime(Date finishTime) {
        this.finishTime = finishTime;
    }

    public String getIdentity() {
        return identity;
    }

    public void setIdentity(String identity) {
        this.identity = identity;
    }

    public String getJobType() {
        return jobType;
    }

    public void setJobType(String jobType) {
        this.jobType = jobType;
    }

    public Boolean getPersonnel() {
        return personnel;
    }

    public void setPersonnel(Boolean personnel) {
        this.personnel = personnel;
        if (null != personnel) {
            setPersonnelText(personnel == true ? "在职" : "离职");
        }
    }

    public String getPersonnelText() {
        return personnelText;
    }

    public void setPersonnelText(String personnelText) {

        this.personnelText = personnelText;
    }
}
